<?php
namespace App\Controllers\Message;

use App\Models\User\User;
use App\Libs\Views\Json;
use App\Libs\Base\Constant;
use App\Models\Message\Message;
class GetExpandMessageDetail extends \App\Libs\Base\BaseAction
{

    public function execute()
    {
        if(!$this->request->hasQuery('id')){
            return Json::view(1,'缺少参数',NULL);
        }
        $msgid = $this->request->getQuery('id');
        $matchMsg = Message::findOne($msgid);
        if(empty($matchMsg)){
            return Json::view(1,'消息不存在',NULL);
        }
        if(!in_array($matchMsg->type,[1])){
            return Json::view(1,'接口调用错误',NULL);
        }
        $data = json_decode($matchMsg->data,true);
        return Json::view(0,'ok',$data);

    }



}
